Skip to content

feat: TLS pairing with confirmation, a sandboxed Claude Code route and skill name checks - #16

Merged
nodemode-ai merged 8 commits into
mainfrom
fix/owner-decisions-2026-11-29
Nov 30, 2026
Merged

nodemode-ai merged 8 commits into
mainfrom
fix/owner-decisions-2026-11-29

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pairing a device now needs confirmation in the FormAT window: a scan opens a waiting page on the device, and Settings, Other devices shows the device's name, a check number and the certificate fingerprint, with Allow and Turn down.
  • Pairing codes and waiting pairing requests run out after five minutes.
  • devices.start, devices.revoke, devices.forget and the new devices.answer run only from the FormAT window on this computer; devices.status gives paired devices and agents no pairing link, QR code or waiting devices.
  • A paired request re-checks its token after the unpair watch is registered.
  • New tests in backend/tests/test_device_pairing_consent.py; the manual pages docs/other-devices.md, docs/settings.md and docs/troubleshooting.md are updated.
  • Claude Code route: each reply passes a settings file for that launch that turns on Claude Code's own sandbox, limits writes to the chat folder and network to the host names the person lists (new setting claudeCodeDomains), and turns off bypass permissions mode. Launch arguments carrying a bypass flag or mode are refused.
  • Settings, Tools, Sandbox shows whether Claude Code's commands run sandboxed on this computer, in plain words, and has a field for the host names they may reach.
  • Platforms covered: macOS, and Linux or WSL 2 with bubblewrap and socat. On other platforms, Windows included, the route runs unsandboxed and the window says so.
  • Skill names already in use are not replaced without asking. The window offers Overwrite, Keep both (under a free name such as name-2) or Cancel. Commands answer 409 with data.clash unless overwrite or a new name is passed. New command skill.clash.
  • Claude's save_skill tool needs an explicit overwrite to replace a skill. A plugin is not added when it would replace a skill it did not bring.
  • New tests: backend/tests/test_claude_code_sandbox.py (each platform with a faked environment) and backend/tests/test_skill_names.py.
  • Claude Code's own file tools are kept off the home folder, the data folder and the engine's key file through its permission rules, whether or not the system sandbox is available; only the chat folder, uploads and skills stay readable.

Tests

  • Each change has tests that fail on the code before it.
  • The repo's CI commands were run locally on macOS; every local failure also fails on main in the same environment. Please rely on this PR's CI for Linux and Windows.

How to ship

  • Follows the earlier hardening PR, already merged. Independent of other repos. No version bump.

… own revocable token

The devices listener now runs on https with a self-signed certificate made
once per install (key kept 0600 in the data folder). The pairing link carries
the certificate's SHA-256 fingerprint and pairing refuses a link for any other
certificate. Each pairing spends a one-time code and issues a token for that
device alone, stored as a hash; devices.list and devices.revoke list and unpair
devices, and unpairing closes the device's open connections. A plain http
request to the listener gets no answer.
…print in Settings

Settings, Other devices shows the listener certificate's SHA-256 fingerprint
under the pairing code and a keyed list of paired devices, each with Unpair.
The window repaints the section on devices.changed, so a spent code is
replaced on screen after a device pairs.
…d keep pairing window-only

A scan of the pairing code now opens a waiting page on the device and a
request in Settings, Other devices, with the device's name, a check number
and the certificate fingerprint; the device token is issued only after Allow
in FormAT's window. Pairing codes and waiting requests run out after five
minutes. devices.start, devices.revoke, devices.forget and the new
devices.answer run only from the window on this computer, and devices.status
returns no pairing link, QR code or waiting devices to a paired device or an
agent. A paired request re-checks its token once the revocation watch is
registered.
…one lock

A device allowed in the window gets its token in the same step that takes
its request out of the table, and devices.forget drops waiting requests and
unpairs every device in one step under the same lock, so forgetting devices
while an allowed device collects its token leaves it unpaired.
… skill of the same name

Claude Code route: each reply passes a settings file FormAT writes for that
launch (--settings, with --setting-sources user so settings in the chat folder
are not read). It turns Claude Code's sandbox on where it can run (macOS; Linux
and WSL 2 with bubblewrap and socat), limits writes to the chat's folder and
network to the host names in the new claudeCodeDomains setting, ignores the
unsandboxed escape, and disables bypass permissions mode. A launch carrying a
bypass flag or mode is refused. Where the sandbox is not available the reply
still runs and Settings, Tools, Sandbox says its commands are not sandboxed.

Skills: adding, writing or installing a skill whose name is taken is refused
with 409 and data.clash unless overwrite is true or a new name is given; the
window asks Overwrite, Keep both or Cancel. Claude's save_skill needs an
explicit overwrite, and a plugin is not added when it would replace a skill it
did not bring. New command skill.clash.
…dboxed commands off FormAT's data folder

The launch settings deny Claude Code's Edit rules on the uploads and skills
folders on every platform (Windows paths in the //c/ form), hide FormAT's
data folder from sandboxed commands apart from the chat folder, uploads and
skills, and refuse bypass flags also when spelled --flag=value.
…nd key file

The paths hidden from Claude Code now match FormAT's own sandbox: the home
folder, the resolved data folder and the backend .env (or the backend folder
when there is none). Besides the sandbox's denyRead, each becomes Read and Edit
deny rules for Claude Code's file tools on every platform, also when the
sandbox is unavailable. Since deny rules win over allow rules, each hidden
folder is denied entry by entry beside the path to the chat folder, uploads
and skills, which are then allowed for reading.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 23:21
@nodemode-ai
nodemode-ai merged commit 4ac6508 into main Nov 30, 2026
5 checks passed
@nodemode-ai
nodemode-ai deleted the fix/owner-decisions-2026-11-29 branch November 30, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants